﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;

namespace UI
{
    public class FuncNavAudioCtrl : MonoBehaviour
    {
        public List<AudioClip> normalClips;
        public List<AudioClip> morningClips;
        public List<AudioClip> eveningClips;

        public UITweener talkTextTweener;
        public UILabel tweenerTaklTabel;

        public void Play()
        {
            List<AudioClip> clips = new List<AudioClip>();
            if (ServerTimerTool.CurrentTime.Hour >= 6 && ServerTimerTool.CurrentTime.Hour < 10)
            {
                clips.AddRange(morningClips);
            }
            else if (ServerTimerTool.CurrentTime.Hour >= 18 && ServerTimerTool.CurrentTime.Hour < 21)
            {
                clips.AddRange(eveningClips);
            }
            clips.AddRange(normalClips);
            int index = Random.Range(0, clips.Count);
            //AudioManager.Instance.PlayUIAudio(clips[index].name);
            tweenerTaklTabel.text = TableTextBlo.GetText(clips[index].name);
            talkTextTweener.ResetToBeginning();
            talkTextTweener.PlayForward();
        }
    }
}
